# 子路由
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view()),

    # 判断用户名是否重复
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameCountView.as_view()),
    # 判断手机号是否重复
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),
    # 登录页的路由
    url(r'^login/$', views.LoginView.as_view(), name="login"),
    # 退出的路由
    url(r'^logout/$', views.LogOutView.as_view(), name='logout'),
    # 用户中心
    url(r'^info/$', views.UserInfoView.as_view(), name="info"),
    # 保存邮箱
    url(r'^emails/$', views.EmailView.as_view(), name="email"),
    # 激活邮箱
    url(r'^emails/verification/$', views.EmailVerifyView.as_view(), name="verify"),
    # 收货地址
    url(r'^address/$', views.AddressView.as_view(), name="address"),
    # 增加地址
    url(r'^addresses/create/$', views.AddressAddView.as_view()),
    # 11. 修改密码  password/
    url(r'^password/$', views.ChangePwdAddView.as_view(), name='password'),
    # 用户浏览记录/browse_histories/
    url(r'^browse_histories/$', views.UserBrowserView.as_view()),
]
